package OOday02;

public class OODay02HomeWork {

    /*
    public class Person {
    String name;
    int age;
    String address;

    public Person(String name, int age, String address) {
        this.name = name;
        this.age = age;
        this.address = address;
    }
    void eat(){
        System.out.println(name+"正在吃饭----");
    }
    void sleep(){
        System.out.println(name+"正在睡觉----");
    }
    void sayHi(){
        System.out.println("大家好我叫"+name+"今年"+age+"岁了，我住在"+address);
    }


public class Student extends Person{
    String className;
    String stuId;

    void study(){
        System.out.println(name+"在学习");
    }

    public Student(String name, int age, String address, String className, String stuId) {
        super(name, age, address);
        this.className = className;
        this.stuId = stuId;
    }
    void sayHi(){
        System.out.println("大家好我叫"+name+"我在"+className+"班,今年"+age+"岁了，我住在"+address);
    }
}


public class Teacher extends Person{
    double salary;

    public Teacher(String name, int age, String address, double salary) {
        super(name, age, address);
        this.salary = salary;
    }

    public void sayHi(){
        System.out.println("我叫"+name);
    }

    void teach(){
        System.out.println(name+"正在讲课————————");
    }
}


public class Doctor extends Person{
    String title;

    public Doctor(String name, int age, String address, String title) {
        super(name, age, address);
        this.title = title;
    }

    void cut(){
        System.out.println(name+"正在手术————————");
    }
}



public class Test {
    public static void main(String[] args) {
        /*Student student = new Student("李四",21,"太清宫","java","23030000");
        student.eat();
        student.sayHi();
        student.study();

        Doctor doctor = new Doctor("张三",21,"太清宫","主任");
        doctor.cut();
        doctor.sayHi();

        Teacher teacher = new Teacher("王五",21,"太清宫",10000);
        teacher.teach();
        teacher.sayHi();

}
}


public class Animal {
    String name ;
    int age;
    String color;

    public Animal() {
    }

    public Animal(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public void drink(){
        System.out.println(age+"岁"+color+"色的"+name+"在喝水");
    }
    public void eat(){
        System.out.println(name+"在吃饭");
    }
}


public class Dog extends Animal{
    public Dog(String name, int age, String color) {
        super(name, age, color);
    }

    @Override
    public void eat() {
        System.out.println(name+"再吃骨头");
    }

    public void lookhome(){
        System.out.println(name+"在看家");
    }
}

public class Chick extends Animal{
    public Chick(String name, int age, String color) {
        super(name, age, color);
    }

    @Override
    public void eat() {
        System.out.println(name+"在吃小米");
    }

    public void layEggs(){
        System.out.println(name+"再下蛋");
    }
}
package OOday02;

public class Fish extends Animal{
    public Fish(String name, int age, String color) {
        super(name, age, color);
    }

    @Override
    public void eat() {
        System.out.println(name+"在吃饲料");
    }
}

public class AnimalTest {
    public static void main(String[] args) {

        //狗
        Dog dog = new Dog("大黄",2,"黄");
        dog.eat();
        dog.drink();
        dog.lookhome();

        //鸡
        Chick chick = new Chick("小黄",3,"黄");
        chick.eat();
        chick.drink();
        chick.layEggs();

        //鱼
        Fish fish = new Fish("小黑",4,"黑");
        fish.eat();
        fish.drink();

    }
}






*/
}
